<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
</body>

<script>
    // 定义一个30项的数组，数组的每一项要求都是6，每间隔5个数字，求出这五个数的平均值
    var arr1 = [];
    var arr2 = [];
    function even(arr1,arr2,n){
        
        for(var i = 0 ; i < n ; i++){
            arr1[i] = 6;
        }
        
        for(var n = 0 ;n < 6; n++ ){
            var sum = 0;
            for(var m = 0; m < 5 ;m++ ){
                sum += arr1[m + 5 * n]
            }
            arr2[n] = sum / 5;
        }
        return arr2
    }
    even(arr1,arr2,30)
    console.log(even(arr1,arr2,30))

</script>
</html>